﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Util;

public class FanPlatformCtl : PlatformCtl
{

    public float windPower = 10f;

    private Rigidbody2D playerRigidbody;

    public override void Start()
    {
        base.Start();

        playerRigidbody = GameManager.Instance.PlayerGameObject.GetComponent<Rigidbody2D>();
    }




    public override void Update()
    {
        base.Update();


    }

    private void OnCollisionEnter2D(Collision2D collision)
    {
        if (Utils.IsPlayer(collision))
        {
            playerRigidbody.velocity = new Vector2(playerRigidbody.velocity.x, windPower);
        }
    }
}
